package com.origin.chaos.framework.core.util;

/**
 * @author: tao.ding
 * @date 2021-07-02
 */
public class ArraysUtil {
    /**
     * 深克隆
     *
     * @param source 原始二维数组
     * @return 返回深克隆之后的二维数组
     */
    public static int[][] cloneOf(int[][] source) {
        int[][] clone = new int[source.length][source[0].length];
        for (int i = 0; i < source.length; i++) {
            System.arraycopy(source[i], 0, clone[i], 0, source[i].length);
        }
        return clone;
    }
}
